<template>
  <div>
    <h3>差异报告查询</h3>
    <el-card>
      <div>
        <el-form ref="form" :model="queryForm" inline label-position="top">
          <el-form-item label="备案主体名称" prop="">
            <el-input v-model="queryForm.bodyName" size="small" placeholder="请输入备案主体名称" clearable></el-input>
          </el-form-item>
          <el-form-item label="统一社会信用代码" prop="">
            <el-input v-model="queryForm.companyCode" size="small" placeholder="请输统一社会信用代码" clearable></el-input>
          </el-form-item>
          <el-form-item label="差异报告编码" prop="">
            <el-input v-model="queryForm.companyCode" size="small" placeholder="请输差异报告编码" clearable></el-input>
          </el-form-item>
          <el-form-item label="关联核验记录流水" prop="">
            <el-input v-model="queryForm.serialID" size="small" placeholder="请输入关联核验记录流水" clearable></el-input>
          </el-form-item>
          <el-form-item label="办理状态">
            <el-select v-model="queryForm.result" size="small" placeholder="请选择办理状态" clearable>
              <el-option label="待审核" value="1"></el-option>
              <el-option label="已办结" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="处理结果">
            <el-select v-model="queryForm.result" size="small" placeholder="请选择处理结果" clearable>
              <el-option label="待审核" value="1"></el-option>
              <el-option label="已审核" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="持续关注">
            <el-select v-model="queryForm.result" size="small" placeholder="请选择持续关注" clearable>
              <el-option label="是" value="1"></el-option>
              <el-option label="否" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="提交时间" prop="">
            <el-date-picker
              size="small"
              v-model="time"
              type="daterange"
              range-separator="至"
              start-placeholder="提交开始"
              end-placeholder="提交结束"
              clearable
            >
            </el-date-picker>
          </el-form-item>
          <el-form-item label="办结时间" prop="">
            <el-date-picker
              size="small"
              v-model="time"
              type="daterange"
              range-separator="至"
              start-placeholder="办结开始"
              end-placeholder="办结结束"
              clearable
            >
            </el-date-picker>
          </el-form-item>
          <el-form-item label="" style="padding-top: 24px">
            <el-button size="mini" type="primary" icon="el-icon-search">查询</el-button>
            <el-button size="mini" type="primary" plain icon="el-icon-refresh">重置</el-button>
          </el-form-item>
        </el-form>
        <el-table
          :data="tableDatas"
          style="width: 100%"
          border
          class="table-box"
          :header-cell-style="{ background: '#fff', color: '#333' }"
        >
          <el-table-column label="序号" width="100">
            <template slot-scope="scope">
              {{ (queryForm.page - 1) * queryForm.size + scope.$index + 1 }}
              <i class="el-icon-star-on" style="color: #ffb200" v-if="scope.row.status == '2'"></i>
            </template>
          </el-table-column>
          <el-table-column prop="id" label="差异报告编码" width="160" show-overflow-tooltip> </el-table-column>
          <el-table-column prop="serial" label="关联核验记录流水号" width="160" show-overflow-tooltip> </el-table-column>
          <el-table-column prop="code" label="统一社会信用代码" width="160" show-overflow-tooltip> </el-table-column>
          <el-table-column prop="bodyName" label="备案主体名称" width="160" show-overflow-tooltip> </el-table-column>
          <el-table-column prop="bodyType" label="备案主体类型" width="140" show-overflow-tooltip> </el-table-column>
          <el-table-column prop="status" label="办理状态" width="120" show-overflow-tooltip>
            <template slot-scope="{ row }">
              {{ row.status == '1' ? '待审核' : '已办结' }}
            </template>
          </el-table-column>
          <el-table-column prop="result" label="处理结果" width="120" show-overflow-tooltip> </el-table-column>
          <el-table-column prop="flag" label="持续关注" width="120" show-overflow-tooltip> </el-table-column>
          <el-table-column prop="orgName" label="报告办理机构" width="140" show-overflow-tooltip> </el-table-column>
          <el-table-column prop="optUser" label="初审人" width="100" show-overflow-tooltip> </el-table-column>
          <el-table-column prop="reUser" label="复审人" width="100" show-overflow-tooltip> </el-table-column>
          <el-table-column prop="prop" label="操作" width="300" fixed="right">
            <template slot-scope="{ row }">
              <el-button type="text" icon="el-icon-view" @click="viewDetail(row)">查看</el-button>
              <el-button type="text" icon="el-icon-download" @click="downloadReport(row)">下载差异报告</el-button>
              <el-button
                type="text"
                icon="el-icon-edit-outline"
                :disabled="row.status == '1'"
                v-if="row.result !== '-'"
                @click="caseApply(row)"
                >案例申请</el-button
              >
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="queryForm.page"
          :page-sizes="[10, 20, 30, 40]"
          :page-size="queryForm.size"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
          class="pagination"
        />
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  name: 'DiffReportIndex',

  data() {
    return {
      time: [],
      queryForm: {
        bodyName: '',
        companyCode: '',
        serialID: '',
        startTime: '',
        endTime: '',
        result: '',
        page: 1,
        size: 10,
      },
      total: 0,
      tableDatas: [
        {
          id: 'QB202508080001',
          serial: 'CHECK2024120600000001',
          code: '914301003388567',
          bodyName: '世瑞科技股份有限公司',
          bodyType: '公司',
          status: '2',
          result: '全部通过',
          flag: '否',
          orgName: '华南科技股份有限公司',
          optUser: '测试人1',
          reUser: '测试人2',
        },
        {
          id: 'QB202508080002',
          serial: 'CHECK2024120600000001',
          code: '914301003388567',
          bodyName: '世瑞科技股份有限公司',
          bodyType: '公司',
          status: '2',
          result: '全部通过',
          flag: '否',
          orgName: '华南科技股份有限公司',
          optUser: '测试人1',
          reUser: '测试人2',
        },
        {
          id: 'QB202508080003',
          serial: 'CHECK2024120600000001',
          code: '914301003388567',
          bodyName: '世瑞科技股份有限公司',
          bodyType: '公司',
          status: '1',
          result: '-',
          flag: '否',
          orgName: '华南科技股份有限公司',
          optUser: '-',
          reUser: '-',
        },
        {
          id: 'QB202508080004',
          serial: 'CHECK2024120600000001',
          code: '914301003388567',
          bodyName: '世瑞科技股份有限公司',
          bodyType: '公司',
          status: '1',
          result: '-',
          flag: '否',
          orgName: '华南科技股份有限公司',
          optUser: '-',
          reUser: '-',
        },
        {
          id: 'QB202508080005',
          serial: 'CHECK2024120600000001',
          code: '914301003388567',
          bodyName: '世瑞科技股份有限公司',
          bodyType: '公司',
          status: '1',
          result: '-',
          flag: '否',
          orgName: '华南科技股份有限公司',
          optUser: '-',
          reUser: '-',
        },
        {
          id: 'QB202508080006',
          serial: 'CHECK2024120600000001',
          code: '914301003388567',
          bodyName: '世瑞科技股份有限公司',
          bodyType: '公司',
          status: '1',
          result: '-',
          flag: '否',
          orgName: '华南科技股份有限公司',
          optUser: '-',
          reUser: '-',
        },
      ],
    }
  },
  created() {
    this.total = this.tableDatas.length
  },
  mounted() {},

  methods: {
    viewDetail(row) {
      this.$router.push('/diffreport/detail')
    },
    downloadReport(rwo) {},
    viewBackups(row) {},
    handleSizeChange(val) {},
    handleCurrentChange(val) {},
    caseApply(row) {
      this.$router.push('/case/caseApply')
    },
  },
}
</script>
<style lang="scss" scoped>
.pagination {
  text-align: right;
  margin-top: 12px;
}
::v-deep .el-range-editor--small.el-input__inner,::v-deep .el-input--small .el-input__inner {
  width: 222px;
}
::v-deep .el-form-item__label {
  padding: 0;
  line-height: 24px;
}
::v-deep .el-form-item {
  margin-bottom: 0;
}
</style>